package vek.XML.parsedObjects;

import vek.XML.Parsers.XMLParserAttractions; // used for javadoc

/**
 * Simple class to contain the AttractionsPOI data read by the XML Parsers.
 * This class is then used to create the Attractions object by giving this object to its constructor.
 * When a ParsedAttractions POI object is created, the ParsedPOI class takes care of its own variable changes.
 * This is done by calling the ParsedPOI constructor which takes a ParsedPOI object as argument.
 * The variables are then extracted from this object and put into the AttractionsPOI object.
 * This is done to make sure that each class only deals with its own variables, 
 * thus this class does not have to deal with the variables in the ParsedPOI class,
 * Rather it lets the ParsedPOI class take care of that, and because it inherits the ParsedPOI variables,
 * it also has the ParsedPOI variables.
 * @see XMLParserAttractionsPOI
 * @author Christian, Michal og Jakob (Hold 1, gruppe 2)
 */
public class ParsedAttractions extends ParsedPOI{
    
    public ParsedPOI parsedPOI;
    
    public ParsedAddresse parsedAddresse;
    public int phonenumber;
    public String url;
    public String urlShown;
    public String email;
    public ParsedOpeninghours parsedOpeninghours;
    public String description;
    public boolean toilets;
    public boolean elevators;
    public boolean handicapfriendly;
    
    /**
     * 
     * @param pa the ParsedAttractions object which contains all the data from the parsedAttraction part of the XML as well as contain the data from the poi part of the XML
     */
    public ParsedAttractions(ParsedAttractions pa)
    {
        super(pa.parsedPOI);
        parsedAddresse = pa.parsedAddresse;
        phonenumber = pa.phonenumber;
        url = pa.url;
        urlShown = pa.urlShown;
        email = pa.email;
        parsedOpeninghours = pa.parsedOpeninghours;
        description = pa.description;
        toilets = pa.toilets;
        elevators = pa.elevators;
        handicapfriendly = pa.handicapfriendly;

    }
     /**
     * Creates a ParsedAttraction object.
     * @param ppoi the ParsedPOI object for this POI
     * @param pa the ParsedAddresses object for this POI
     * @param pn the phone number for the POI
     * @param u the URL for this POI
     * @param em the e-mail addres for this POI
     * @param oh the ParsedOpeninghours object for this POI
     * @param desc a brief description of this POI
     * @param toi whether or not this POI has bathroom facilities
     * @param elev whether or not this POI an elevator/elevators
     * @param hand whether or not this POI are handicap friendly
     */
    public ParsedAttractions(ParsedPOI ppoi, ParsedAddresse pa, int pn,
            String u, String us, String em, ParsedOpeninghours oh, String desc, 
            boolean toi, boolean elev, boolean hand)
    {
        super(ppoi);
        parsedPOI = ppoi;
        parsedAddresse = pa;
        phonenumber = pn;
        url = u;
        urlShown = us;
        email = em;
        parsedOpeninghours = oh;
        description = desc;
        toilets = toi;
        elevators = elev;
        handicapfriendly = hand;
    }
    
    /**
     * Gets the parsedPOI object whic this object contains.
     * @return the Parsed POI object this object contains
     */
    
    public ParsedPOI getParsedPOI()
    {
        return parsedPOI;
    }
    
    @Override
    public String toString()
    {
        String s = super.toString();
        
        s += " adresse: " + parsedAddresse.toString() + " phone: " + phonenumber 
                + " url: " + url + " showed url: " + urlShown + " emai " 
                + email + " opining hours: " + parsedOpeninghours + " desc: " 
                + description + "toilets: " + toilets + " elevators: " 
                + elevators + " handicapfriendly " + handicapfriendly;
          
        return s;
    }

 
    
    
    

}
